#ifndef PLAYER_H_
#define PLAYER_H_

// INCLUDES //
#include "object.h"
#include <vector.h>
//////////////

// DEFINES //
#define PLAYER_CASTING_ANIM_DELAY		100

/**
* An object that represents a player.
* 
* @author dfoelber
**/
class PlayerObject : public Object
{
public:
	/**
	* Constructor
	* 
	* @param image the image the player
	* @param enemy If the player is an enemy (mirror flip)
	* @param color The color of the player
	**/
	PlayerObject( Surface* image, bool enemy, Color color );
	
	/**
	* Deconstructor
	**/
	virtual ~PlayerObject();
	
	/**
	* Accessor to the object's image.
	* 
	* Overridden from Object
	* 
	* @return the surface
	**/
	virtual Surface* GetSurface() { return image; }

	/**
	* Lets the object know that time has passed and to move accordingly.
	* 
	* @param ms The time passed since last called
	* 
	* overridden from Object
	**/
	virtual void TimePassed( int ms );
	
	/**
	* Starts a casting animation.
	**/
	void StartCastAnimation();
	
	/**
	* If the player is casting.
	**/
	bool IsCasting() { return isCasting; }
	
private:
	/**
	* Creates the animation vector
	**/
	void CreateAnimations(bool enemy, Color color);
	
	/**
	* Creates and pushes back a specific image
	**/
	void PushBack(Surface* stock, bool enemy, Color color);
	
private:
	/// The image of the object
	Surface*				image;
	/// The static image
	Surface*				staticImage;
	/// The animation surfaces
	vector<Surface*>		anims;
	/// The color key for the image
	int						colorKey;
	/// Animation counter
	int						animCounter;
	/// Animation index
	int						animIndex;
	/// If the player is casting
	bool					isCasting;
};

#endif /*PLAYER_H_*/
